<?php
/**
 * @author Anh Nguyen
 * @copyright 2012
 */
 defined('APP') or die('Denied access !');
 
 class Default_Controller_Home extends Controller
 {
    public function indexAction()
    {
        session_start();
        $this->tpl->tpl_start('home');
        if( !isset($_SESSION[Core::$config['session_pre'] . 'username']) OR !isset($_COOKIE[Core::$config['session_pre'] . 'username'])) {
            $this->tpl->parse('login_form');
            $this->tpl->parse('if_login');
            for($i=1; $i<=31; $i++)
            {
                $this->tpl->assign('day',$i);
                $this->tpl->parse('uBirthday-Day');
                
                if($i <= 12) {
                    $this->tpl->assign('month',$i);
                    $this->tpl->parse('uBirthday-Month');
                }
            }
            for($i=1950; $i <= gmdate('Y',time()); $i++)
            {
                $this->tpl->assign('year', $i);
                $this->tpl->parse('uBirthday-Year');
            }
            $this->tpl->assign('url_captcha',Core::site_url('captcha'));
        }
        $this->tpl->assign($this->cache->get('url_index'));
        $this->tpl->parse('url_index');
        $this->tpl->assign(
                            array('web_title'   =>      Core::$config['web_title'],
                                  'base_url'    =>      BASE_URL)
                            );
        $this->tpl->tpl_out();
        $mem = memory_get_usage();
        echo $mem/(1000 *1000) . 'Mb';
    }
	
 }
?>